# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=smali-cfgs
pkgver=6.4450418
pkgrel=4
pkgdesc="Smali Control Flow Graph's."
groups=('blackarch' 'blackarch-mobile' 'blackarch-misc')
arch=('any')
url='https://github.com/ch0psticks/Smali-CFGs'
license=('GPL2')
depends=('python2' 'python2-pydot')
makedepends=('git')
source=("$pkgname::git+https://github.com/ch0psticks/Smali-CFGs.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1 i\#!/usr/bin/python2' Flow.py
  sed -i '1 i\#!/usr/bin/python2' XRef.py
}

package() {
  cd $pkgname

  install -Dm 755 Flow.py "$pkgdir/usr/bin/$pkgname-flow"
  install -Dm 755 XRef.py "$pkgdir/usr/bin/$pkgname-xref"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/imgs" imgs/*
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

